Skip to content

feat: respect per-flag insightsEnabled for evaluation events - #21

Merged
deleteLater merged 2 commits into
masterfrom
feat/insights-enabled
Nov 3, 2026
Merged

deleteLater merged 2 commits into
masterfrom
feat/insights-enabled

Conversation

@cosmos-explorer

@cosmos-explorer cosmos-explorer commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Feature flags with insightsEnabled: false currently still produce evaluation events. Suppress those records while keeping evaluation values, variation IDs, match reasons, and experiment eligibility unchanged. Missing, null, and non-boolean settings retain the evaluation server's default-enabled behavior.

Summary by CodeRabbit

  • Bug Fixes
    • Flag evaluation events are now collected only when insights are enabled. Setting insightsEnabled to false disables collection; missing or other values leave it enabled.
    • This applies to standard evaluations and later access to previously evaluated flag states. Offline and closed-client event suppression remains unchanged.
  • Documentation
    • Clarified when flag evaluation events are collected and how the insights setting affects them.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable issue was found.

Summary

The PR suppresses evaluation events when a flag’s insightsEnabled value is explicitly false, without changing evaluation results or experiment eligibility.

  • Flags with insights disabled stop adding evaluation events.

Reviews (2) · Last reviewed commit: "Remove evaluation insights section from ..." · Reviewed by Greptile

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

Evaluation events are collected unless insightsEnabled is explicitly false. Event eligibility is captured during evaluation. Evaluation results and other event types remain unchanged.

Changes: Evaluation insights

Layer / File(s) Summary
Gate evaluation events and verify delivery
fbclient/evaluator.py, fbclient/client.py, fbclient/common_types.py, tests/test_insights_enabled.py, README.md
The evaluator omits flag events only when insights are explicitly false. The client skips ineligible flag events. Tests cover synchronized and external flag data, evaluations, updates, snapshots, and existing event suppression. Documentation describes the behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Suggested reviewers: dsun0720

Merge Risk: Minimal · previous review a1ab7

No actionable merge-blocking risk was identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: applying per-flag insightsEnabled settings to evaluation events.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 7 functions across 4 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2bee0836-43d7-47c2-8af7-ec62e2c1605b
Commits

Reviewing files that changed from the base of the PR and between db68035 and a1ab7a2.

Files selected for processing: 5
  • README.md
  • fbclient/client.py
  • fbclient/common_types.py
  • fbclient/evaluator.py
  • tests/test_insights_enabled.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Removed section on evaluation insights from README.
@cosmos-explorer cosmos-explorer self-assigned this Nov 3, 2026
@cosmos-explorer cosmos-explorer moved this to PR Ready in FeatBit Nov 3, 2026

@deleteLater deleteLater left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@deleteLater
deleteLater merged commit 84aee49 into master Nov 3, 2026
13 checks passed
@deleteLater
deleteLater deleted the feat/insights-enabled branch November 3, 2026 08:23
@github-project-automation github-project-automation Bot moved this from PR Ready to Done in FeatBit Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants